package com.springmvc.springbootOne.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/*@RestController*/
@Controller
public class MainController {
	//重要特性，如果把value="/index",会跳转到static下面的index.html页面，否则跳转到templates下面的index.html页面
    @RequestMapping(value="/springfirstpage",method = RequestMethod.GET)
    public String home() {
    	System.out.println("fdsfsd");
    	//此时会去templates目录下去找文件
    	return "/index";
    }
    
    @RequestMapping(value="/datagridfilter",method = RequestMethod.GET)
    public String datagridfilter() {
    	System.out.println("datagridfilter");
    	return "datagrid2";
    }
    
    @RequestMapping(value="/test",method = RequestMethod.GET)
    public String test(Model model) {
    	System.out.println("test");
    	model.addAttribute("name", "Dear");
    	return "thymeleaf_test";
    }

}
